<template>
	<view >
		<view class="grid-body">
		<uni-grid :column="4" :showBorder="false">
		<uni-grid-item>
		    <view class="grid-item-box"  @click="task">
		      <uni-icons type="wallet-filled" size="30"></uni-icons>
		      <text class="text">我的任务</text>
		    </view>
		  </uni-grid-item>
		  <uni-grid-item>
		    <view class="grid-item-box"  @click="cs">
		      <uni-icons type="wallet-filled" size="30"></uni-icons>
		      <text class="text">我的抄送</text>
		    </view>
		  </uni-grid-item>
     <uni-grid-item v-if="checkRole(['ceo','admin'])">
        <view class="grid-item-box"  @click="taskAllow">
          <uni-icons type="wallet-filled" size="30"></uni-icons>
          <text class="text">任务审批</text>
        </view>
      </uni-grid-item>
      <uni-grid-item>
        <view class="grid-item-box"  @click="duty">
          <uni-icons type="wallet-filled" size="30"></uni-icons>
          <text class="text">请假</text>
        </view>
      </uni-grid-item>
      <uni-grid-item v-if="checkRole(['ceo','admin','duty'])">
        <view class="grid-item-box"  @click="dutyToday">
          <uni-icons type="wallet-filled" size="30"></uni-icons>
          <text class="text">当日请假情况</text>
        </view>
      </uni-grid-item>
				<!-- <uni-grid-item>
				  <view class="grid-item-box" @click="ces">
				    <uni-icons type="chat-filled" size="30"></uni-icons>
				    <text class="text">测试</text>
				  </view>
				</uni-grid-item> -->
		</uni-grid>
		</view>
	</view>
</template>

<script>
  import { checkPermi, checkRole } from "@/utils/permission"; 
	export default{
		data(){
			return{
				
			}
			
		},

		methods: {
      checkPermi,
          checkRole,
      // 我的任务
			task(){
				uni.navigateTo({
					url:"../pagesA/task/task"
				})
			},
      // 任务审批
      taskAllow(){
				uni.navigateTo({
					url:"../pagesA/taskAllow/taskAllow"
				})
			},
      // 测试
			ces(){
				uni.navigateTo({
				url:"../pagesA/ces/ces"
				})
			},
      // 我的请假
      duty(){
      	uni.navigateTo({
      	url:"../pagesB/duty/duty"
      	})
      },
      // 我的抄送
			cs(){
				uni.navigateTo({
				url:"../pagesA/receivedFeedback/receivedFeedback"
				})
			},
      // 当日请假情况
      dutyToday(){
				uni.navigateTo({
				url:"../pagesB/dutyToday/dutyToday"
				})
			},
			}
	}
</script>
<style lang="scss">
  /* #ifndef APP-NVUE */
  page {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    // background-color: #fff;
    min-height: 100%;
    height: auto;
  }

  view {
    font-size: 14px;
    line-height: inherit;
  }

  /* #endif */

  .text {
    text-align: center;
    font-size: 26rpx;
    margin-top: 10rpx;
  }

  .grid-item-box {
    flex: 1;
    /* #ifndef APP-NVUE */
    display: flex;
    /* #endif */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
  }

  .uni-margin-wrap {
    width: 690rpx;
    width: 100%;
    ;
  }

  .swiper {
    height: 300rpx;
  }

  .swiper-box {
    height: 150px;
  }

  .swiper-item {
    /* #ifndef APP-NVUE */
    display: flex;
    /* #endif */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    height: 300rpx;
    line-height: 300rpx;
  }

  @media screen and (min-width: 500px) {
    .uni-swiper-dot-box {
      width: 400px;
      /* #ifndef APP-NVUE */
      margin: 0 auto;
      /* #endif */
      margin-top: 8px;
    }

    .image {
      width: 100%;
    }
  }
</style>